﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Products.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
<%@ Register assembly="CollectionPager" namespace="SiteUtils" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    

    <asp:DataList ID="DataList1" runat="server" CellPadding="10" RepeatColumns="2" 
        Width="100%" onselectedindexchanged="DataList1_SelectedIndexChanged">
        <ItemTemplate>
     

                <table border="0" cellpadding="5" cellspacing="0" width="100%">
                    <tr>
                        <th colspan="2">
                            <asp:ImageButton ID="btnImage" runat="server" BorderColor="Blue" BorderStyle="Inset"
                                BorderWidth="1px" CommandArgument='<%# Eval("ID") %>' Height="120px" ImageUrl='<%# Eval("Image", "Images/SanPham/{0}") %>'
                                Width="100px" OnClick="btnImage_Click" /></th>
                    </tr>
                                       <tr>
                        <td colspan="2" style="height: 32px">
                            <a href="ProductDetail.aspx?ProductID=<%# Eval("ID") %>"><%# Eval("Name") %></a></td>
                    </tr>                   <tr>
                        <td colspan="2">
                            Tác giả: <%# Eval("TenTacGia")%></td>
                    </tr>                   <tr>
                        <td>
                            Giá Bán:<asp:Label ID="Label1" runat="server" Font-Bold="True" 
                                Font-Size="Small" ForeColor="#D66531" 
                                Text='<%# Eval("Price", " {0:0,0 VNĐ}") %>'></asp:Label>
                        </td>
                        <td align="right">
                            &nbsp;</td>
                    </tr>
                    <tr>
                     <td colspan="2" style="height: 32px">
                            <a href="ProductDetail.aspx?ProductID=<%# Eval("ID") %>" class="RR">xem chi tiết</a></td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td align="right">
                            &nbsp;</td>
                    </tr>
                </table>
    
        </ItemTemplate>
        <ItemStyle Width="50%" />
    </asp:DataList>


    

    
<script>
window.onload = function()
{
    var images = document.forms[0].getElementsByTagName('INPUT');
    
    for(var i=0;i<images.length;i++)
    {
        if(images[i].id.indexOf('btnImage') >= 0)
        {
            images[i].onmouseover = new Function("ShowTooltip('"+images[i].src+"')");
            images[i].onmouseout = HideTooltip;          
        }
    }
}
</script>
    

    <cc1:CollectionPager ID="CollectionPager1" runat="server" LabelText="Trang:" 
    MaxPages="200" PageSize="5" HideOnSinglePage="True" 
    IgnoreQueryString="False" 
    ResultsFormat="Hiển thị sản phẩm: {0}-&gt;{1} (Tổng số sản phẩm là: {2})" 
    ResultsLocation="None" ShowFirstLast="True" ShowLabel="True" 
    ShowPageNumbers="True" UseSlider="True" BackText="« Trước" FirstText="Đầu" 
        LastText="Cuối" NextText="Sau »">
</cc1:CollectionPager>
    </asp:Content>

